package com.zwx.aray.leetcode_10;

/**
 * 给定一个n*n的二维矩阵便是一个图像，将图像旋转90度
 *
 * @author 文希
 * @create 2019-06-30 7:23
 */
public class RoatePicArray {

    private static void rotate(int[][] matrix) {
        if (null == matrix) {
            return;
        }
        int n = matrix.length;
        for (int i = 0; i < n / 2; i++) {
            for (int j = i; j < n - i - 1; j++) {
                int temp = matrix[i][j];
                matrix[i][j] = matrix[n - i - 1][n - 1 - j];
                matrix[n - 1 - i][n - 1 - j] = matrix[j][n - 1 - i];
                matrix[j][n - 1 - i] = temp;
            }
        }
    }
}
